]> git.r.bdr.sh - rbdr/captura/blame - Captura/Core Extensions/CVImageBuffer+cgImage.swift
Add multimonitor support
[rbdr/captura] / Captura / Core Extensions / CVImageBuffer+cgImage.swift
CommitLineData
c9b9e1d6
RBR
1import Foundation
2import ReplayKit
3
4extension CVImageBuffer {
5
7ee43fb8
RBR
6 static let sharedContext = CIContext()
7
c9b9e1d6
RBR
8 var cgImage: CGImage? {
9 let ciImage = CIImage(cvImageBuffer: self)
7ee43fb8 10 return CVImageBuffer.sharedContext.createCGImage(ciImage, from: CGRect(x: 0, y: 0, width: CVPixelBufferGetWidth(self), height: CVPixelBufferGetHeight(self)))
c9b9e1d6
RBR
11 }
12}